#include <stdio.h>
#include "common.h"

typedef int (*INT_funcP)(int,int);

typedef int INT_func(int,int);


int add(int a,int b)
{
    return (a+b);
}

int sub(int a, int b)
{
    return (a-b);
}

int multi(int a,int b)
{
    return (a*b);
}


int main()
{

    {
        __LOG__("函数指针类型");
        INT_funcP add_p = add;
        int ret = add_p(12,13);
        printf("12+13 = %d \n",ret);

        INT_funcP sub_p = sub;
        int ret1 = sub_p(12,13);
        printf("12-13 = %d \n",ret1);

        INT_funcP mutti_p = multi;
        int ret2 = mutti_p(12,23);
        printf("12*13 = %d \n",ret2);
    }

    {
        __LOG__("函数类型");
        INT_func* add_p = add;
        int ret = add_p(12,13);
        printf("12+13 = %d \n",ret);

        INT_func* sub_p = sub;
        int ret1 = sub_p(12,13);
        printf("12-13 = %d \n",ret1);

        INT_func* mutti_p = multi;
        int ret2 = mutti_p(12,23);
        printf("12*13 = %d \n",ret2);
    }

    

    return 0;
}
